package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        //Thread t=new Thread("nice"){//Thread实例化时可以自行指定名字
        Thread t=new Thread(){//若不指定名字则使用系统分配的名字
            public void run(){
                String name=this.getName();
                System.out.println(name);
                long id=this.getId();//id:唯一标识
                System.out.println(id);
                int priority=this.getPriority();
                System.out.println(priority);
                boolean isInterrupted=this.isInterrupted();
                boolean isDaemon=this.isAlive();
                System.out.println("是否被中断："+isInterrupted);
                System.out.println("是否是守护线程："+isDaemon);
                System.out.println("是否还活着："+isAlive());

            }

        };
        t.start();
    }
}
